---
title: 'Resize plugin'
description: 'Plugin for resizing events in the week- and day views.'
---

# Resize

Resize events in the time grid by dragging their bottom edge, and fullday/multiple-day events by dragging their right
edge.

## Install

```bash copy
npm i @schedule-x/resize
```

## Usage

```js
import { createResizePlugin } from '@schedule-x/resize'

const calendar = createCalendar({
  /* other configuration */
  plugins: [
    createResizePlugin()
  ],

  callbacks: {
    onEventUpdate(updatedEvent) {
      console.log('onEventUpdate', updatedEvent)
    },

    // (Optionally) run your validation or side effects
    // return false to stop the update, and true to allow it
    onBeforeEventUpdate(oldEvent, newEvent, $app) {
      return false
    }
  }
})
```

## Configuration

You can configure the length, in minutes, of the intervals that are used when resizing:

```js
import { createResizePlugin } from '@schedule-x/resize'

const calendar = createCalendar({
  /* other configuration */
  plugins: [
    createResizePlugin(30) // 30 minute intervals when resizing
  ]
})
```

Available values are `15` (default), `30` and `60`

## Methods

### setInterval(minutes: number)

Set the interval, in minutes, for resizing events.

```js
import { createResizePlugin } from '@schedule-x/resize'

const resizePlugin = createResizePlugin()

const calendar = createCalendar({
  /* other configuration */
  plugins: [
    resizePlugin
  ]
})

resizePlugin.setInterval(30)
```
